# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html

import scrapy
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose,TakeFirst

class ProxyIpItem(scrapy.Item):
    # define the fields for your item here like:
    # name = scrapy.Field()
    pass
class Xi_Ci_Item(scrapy.Item):
    ip = scrapy.Field()
    port = scrapy.Field()
    proxy_type = scrapy.Field()
    check_time = scrapy.Field()

    def get_insert_sql(self):
        insert_sql = """
            insert into proxy_ip(ip, port, proxy_type,check_time)
            VALUES (%s, %s, %s, %s)
        """
        params = (self["ip"], self["port"], self["proxy_type"], self["check_time"])
        return insert_sql, params
    pass
